<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html><head><title>QTextLength Class Reference</title><style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
td.postheader { font-family: sans-serif }
tr.address { font-family: sans-serif }
body { background: #ffffff; color: black; }
</style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr /><td align="left" valign="top" width="32"><img align="left" border="0" height="32" src="images/rb-logo.png" width="32" /></td><td width="1">&#160;&#160;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&#160;&#183; <a href="classes.html"><font color="#004faf">All Classes</font></a>&#160;&#183; <a href="modules.html"><font color="#004faf">Modules</font></a></td></table><h1 align="center">QTextLength Class Reference<br /><sup><sup>[<a href="qtgui.html">QtGui</a> module]</sup></sup></h1><p>The QTextLength class encapsulates the different types of length
used in a <a href="qtextdocument.html">QTextDocument</a>. <a href="#details">More...</a></p>

<h3>Types</h3><ul><li><div class="fn" />enum <b><a href="qtextlength.html#Type-enum">Type</a></b> { VariableLength, FixedLength, PercentageLength }</li></ul><h3>Methods</h3><ul><li><div class="fn" /><b><a href="qtextlength.html#QTextLength">__init__</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qtextlength.html#QTextLength-2">__init__</a></b> (<i>self</i>, Type&#160;<i>atype</i>, float&#160;<i>avalue</i>)</li><li><div class="fn" /><b><a href="qtextlength.html#QTextLength-3">__init__</a></b> (<i>self</i>, QVariant&#160;<i>variant</i>)</li><li><div class="fn" /><b><a href="qtextlength.html#QTextLength-4">__init__</a></b> (<i>self</i>, QTextLength)</li><li><div class="fn" />float <b><a href="qtextlength.html#rawValue">rawValue</a></b> (<i>self</i>)</li><li><div class="fn" />Type <b><a href="qtextlength.html#type">type</a></b> (<i>self</i>)</li><li><div class="fn" />float <b><a href="qtextlength.html#value">value</a></b> (<i>self</i>, float&#160;<i>maximumLength</i>)</li></ul><h3>Special Methods</h3><ul><li><div class="fn" />bool <b><a href="qtextlength.html#__eq__">__eq__</a></b> (<i>self</i>, QTextLength&#160;<i>other</i>)</li><li><div class="fn" />bool <b><a href="qtextlength.html#__ne__">__ne__</a></b> (<i>self</i>, QTextLength&#160;<i>other</i>)</li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>The QTextLength class encapsulates the different types of length
used in a <a href="qtextdocument.html">QTextDocument</a>.</p>
<p>When we specify a value for the length of an element in a text
document, we often need to provide some other information so that
the length is used in the way we expect. For example, when we
specify a table width, the value can represent a fixed number of
pixels, or it can be a percentage value. This information changes
both the meaning of the value and the way it is used.</p>
<p>Generally, this class is used to specify table widths. These can
be specified either as a fixed amount of pixels, as a percentage of
the containing frame's width, or by a variable width that allows it
to take up just the space it requires.</p>
<hr /><h2>Type Documentation</h2><h3 class="fn"><a name="Type-enum" />QTextLength.Type</h3><p>This enum describes the different types a length object can
have.</p>
<table class="valuelist">
<tr class="odd" valign="top">
<th class="tblConst">Constant</th>
<th class="tblval">Value</th>
<th class="tbldscr">Description</th>
</tr>
<tr>
<td class="topAlign"><tt>QTextLength.VariableLength</tt></td>
<td class="topAlign"><tt>0</tt></td>
<td class="topAlign">The width of the object is variable</td>
</tr>
<tr>
<td class="topAlign"><tt>QTextLength.FixedLength</tt></td>
<td class="topAlign"><tt>1</tt></td>
<td class="topAlign">The width of the object is fixed</td>
</tr>
<tr>
<td class="topAlign"><tt>QTextLength.PercentageLength</tt></td>
<td class="topAlign"><tt>2</tt></td>
<td class="topAlign">The width of the object is in percentage of
the maximum width</td>
</tr>
</table>
<p><b>See also</b> <a href="qtextlength.html#type">type</a>().</p>
<hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QTextLength" />QTextLength.__init__ (<i>self</i>)</h3><p>Constructs a new length object which represents a variable
size.</p>


<h3 class="fn"><a name="QTextLength-2" />QTextLength.__init__ (<i>self</i>, <a href="qtextlength.html#Type-enum">Type</a>&#160;<i>atype</i>, float&#160;<i>avalue</i>)</h3><p>Constructs a new length object of the given <i>type</i> and
<i>value</i>.</p>


<h3 class="fn"><a name="QTextLength-3" />QTextLength.__init__ (<i>self</i>, QVariant&#160;<i>variant</i>)</h3><h3 class="fn"><a name="QTextLength-4" />QTextLength.__init__ (<i>self</i>, <a href="qtextlength.html">QTextLength</a>)</h3><h3 class="fn"><a name="rawValue" />float QTextLength.rawValue (<i>self</i>)</h3><p>Returns the constraint value that is specific for the type of
the length. If the length is <a href="qtextlength.html#Type-enum">QTextLength.PercentageLength</a> then
the raw value is in percent, in the range of 0 to 100. If the
length is <a href="qtextlength.html#Type-enum">QTextLength.FixedLength</a> then that
fixed amount is returned. For variable lengths, zero is
returned.</p>


<h3 class="fn"><a name="type" /><a href="qtextlength.html#Type-enum">Type</a> QTextLength.type (<i>self</i>)</h3><p>Returns the type of this length object.</p>
<p><b>See also</b> <a href="qtextlength.html#Type-enum">QTextLength.Type</a>.</p>


<h3 class="fn"><a name="value" />float QTextLength.value (<i>self</i>, float&#160;<i>maximumLength</i>)</h3><p>Returns the effective length, constrained by the type of the
length object and the specified <i>maximumLength</i>.</p>
<p><b>See also</b> <a href="qtextlength.html#type">type</a>().</p>


<h3 class="fn"><a name="__eq__" />bool QTextLength.__eq__ (<i>self</i>, <a href="qtextlength.html">QTextLength</a>&#160;<i>other</i>)</h3><h3 class="fn"><a name="__ne__" />bool QTextLength.__ne__ (<i>self</i>, <a href="qtextlength.html">QTextLength</a>&#160;<i>other</i>)</h3><address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td align="left" width="25%">PyQt&#160;4.9.1 for X11</td><td align="center" width="50%">Copyright &#169; <a href="http://www.riverbankcomputing.com">Riverbank&#160;Computing&#160;Ltd</a> and <a href="http://www.qtsoftware.com">Nokia</a> 2011</td><td align="right" width="25%">Qt&#160;4.8.0</td></tr></table></div></address></body></html>